-
Notifications
You must be signed in to change notification settings - Fork 10
Feature/download sync #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
187f570 to
0f69672
Compare
|
This is a killer feature! Also, how does background sync work in regards of battery management in Android? |
When a file changes both locally and remotely, automatically upload |
I don't think that's the best way to handle this. Desktop version pulls the file on conflict and names it I think we shouldn't be overwriting remote work, at least not without user confirmation. |
| if (!android.os.Environment.isExternalStorageManager()) { | ||
| val builder = AlertDialog.Builder(this) | ||
| builder.setTitle(getString(R.string.app_name)) | ||
| builder.setMessage("To save offline files, the app needs access to all files.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This strings should probably be translated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, can do micro patch later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets have focus on implementing the sync stuff perfectly, translation etc can be done later
| <string name="db_file" formatted="false">opencloud.db</string> | ||
| <string name="db_name" formatted="false">OpenCloud</string> | ||
| <string name="data_folder" formatted="false">opencloud</string> | ||
| <string name="data_folder" formatted="false">OpenCloud</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necesarry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks better
But whats issue with last write win strategy? The manual user interaction is really bad UX, the Sync before that sync rework worked, but showed conflict. Its just very very unlikely that it will become an issue. The overwrite happens only if i change the file and save it. I think UX should imo have more priority, cuz thats a ~1% chance that it causes issues |
So should we just add the conflict stuff again with a easy option "last write win" ? how should it be solved without causing a really really bad UX? |
Have to test it, but i didn't have both open at same time. I only tested editing something, closing on web, editing 2 seconds later on Android. I planned to test that scenario today |
|
@samolego When both local and remote have changed, download the remote version AND keep the local file renamed as filename_conflicted_copy_.ext |
|
Please test it, and give feedback. edit: Conflict files are in the OpenCloud Folder, not on Server |
569314c to
c55b72f
Compare
This commit consolidates several improvements to the download and synchronization flow:
- Implemented human-readable folder names on external storage for better accessibility.
- Added 'Download all files' and 'Auto-Sync' capabilities.
- Enhanced conflict resolution:
- Automatically create local conflicted copies and download remote versions when both are modified (matching desktop behavior).
- Added a security setting to toggle between 'Prefer local version' and 'Conflicted copy' strategies.
- Improved conflict detection in both sync and direct upload paths.
- Updated user avatars to use Graph API endpoints.
- UI/UX improvements:
- Translated storage permission dialogs to English for consistency.
- Automated folder refresh after conflict resolution.
- Technical debt and stability:
- Fixed DownloadEverythingWorker logic.
- Fixed ScopedStorageProviderTest by properly mocking Environment and updating expectations for non-URI-encoded paths.
c55b72f to
644300d
Compare
Download and Sync Feature
Summary
This PR adds the ability to download all files from the server and keep them synchronized locally. Users can now enable offline access for their entire account through the settings.
Changes
External Storage with Human-Readable Folder Names
Sync Option and Download All Files
DownloadEverythingWorkerto handle bulk downloadsLocalFileSyncWorkerto keep local files in sync with the serverWorker Improvements
DownloadEverythingWorkerto properly iterate through all folders and filesLocalization
Testing
Related Issues
#24